#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	int x = 0;
	scanf("%d %d", &n, &x);
	int win = 0;
	int lose = 0;
	for (int i = 0; i < n; i++)
	{
		if (i - (n - i) == x)
		{
			win = i;
			lose = n - i;
			break;
		}
	}
	if (win == 0 && lose == 0)
	{
		printf("-1");
	}
	else
	{
		printf("%d %d",win,lose);
	}
	return 0;
}